<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('补上传影像处理')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <input type="hidden" name="be" value="2"/>
                <div class="select-list">
                    <ul>
                        <li class="select-time">
                            <p>交易日期</p>
                            <input type="text" class="time-input" placeholder="交易日期" name="trDate"/>
                        </li>
                        <li>
                            <p>机构号</p>
                            <input name="orgCode" id="treeId" type="text" placeholder="请选择" class="form-control" required><!--onclick="selectDeptTree()" -->
                        </li>
                        <li>
                            <p>柜员号</p>
                            <input type="text" name="tellerCode"/>
                        </li>

                        <!--<li>
                            <p>扫描员</p>
                            <input type="text" name="createor"/>
                        </li>
                        <li>
                            <p>补录员</p>
                            <input type="text" name="inputer"/>
                        </li>
                        <li>
                            <p>当前操作员</p>
                            <input type="text" name="capturer"/>
                        </li>
                        <li>
                            <p>强制补录员</p>
                            <input type="text" name="forceInputer"/>
                        </li>
                        <li>
                            <p>状态</p>
                            <select name="status" th:with="type=${@dict.getType('sdi_paea_arc_status')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <p>特殊状态</p>
                            <select name="statusCode" th:with="type=${@dict.getType('sdi_paea_arc_status_code')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>-->
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="query()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="checkInput()"><i class="fa fa-refresh"></i>&nbsp;确定</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('sdi:sdiPaeaArc:edit')}]];
    var removeFlag = [[${@permission.hasPermi('sdi:sdiPaeaArc:remove')}]];
    var statusDatas = [[${@dict.getType('sdi_paea_arc_status')}]];
    var prefixQuery = ctx + "bms/bmsVoucherAssociate";
    var prefix = '/sdi/scan';
    var beDatas = [[${@dict.getType('bms_voucher_type')}]];

    var options = {
        url: prefixQuery + "/list",
        modalName: "补扫登记信息",
        //启用跳转至指定页
        showPageGo: true,
        //启用点击选中行
        clickToSelect: true,
        onDblClickRow: function() {
            checkInput();
        },
        columns: [{
            radio: true
        },
            {
                field : 'id',
                title : '主键',
                visible: false
            },
            {
                field : 'tltCode',
                title : '柜员',
                visible: false
            },
            {
                field : 'trDate',
                title : '交易日期'
            },
            {
                field : 'orgCode',
                title : '机构'
            },
            {
                field : 'noteCount',
                title : '张数'
            },
            {
                field : 'submitTltId',
                title : '提交员'
            },

            {
                field : 'submitTime',
                title : '提交日期'
            },
            {
                field : 'submitStatus',
                title : '提交状态（0-保存 1-提交）',
                visible: false
            },
            {
                field : 'inceptStatus',
                title : '行方接受状态（1-未接受 2-已接受）',
                visible: false
            },
            {
                field : 'inceptTime',
                title : '行方接受日期',
                visible: false
            },
            {
                field : 'inceptTltId',
                title : '行方接受操作员',
                visible: false
            },
            {
                field : 'foreignInceptStatus',
                title : '外方接受状态（1-未接受 2-已接受）',
                visible: false
            },
            {
                field : 'foreignInceptTltId',
                title : '外方接收操作员',
                visible: false
            },
            {
                field : 'foreignInceptTime',
                title : '外方接收时间',
                visible: false
            },
            {
                field : 'packs',
                title : '包数',
                visible: false
            },
            {
                field : 'packId',
                title : '包号',
                visible: false
            },
            {
                field : 'tellerCode',
                title : '柜员编号',
                visible: false
            },
            {
                field : 'auditOrgCode',
                title : '分行机构号',
                visible: false
            },
            {
                field : 'cardLockNum',
                title : '卡封锁号',
                visible: false
            },
            {
                field : 'be',
                title : '登记类型',
                formatter: function(value, row, index) {
                    return $.table.selectDictLabel(beDatas, value);
                }
            }]
    };

    function query() {
        $.table.destroy();
        $.table.init(options);
    }

    //选择机构
    function selectDeptTree() {
        var treeId = $("#treeId").val();
        var deptId = $.common.isEmpty(treeId) ? "00038" : $("#treeId").val();
        var url = ctx + "system/dept/selectDeptTree/" + deptId;
        var options = {
            title: '选择部门',
            width: "380",
            url: url,
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero){
        var tree = layero.find("iframe")[0].contentWindow.$._tree;
        if ($.tree.notAllowParents(tree)) {
            var body = layer.getChildFrame('body', index);
            $("#treeId").val(body.find('#treeId').val());
            layer.close(layer.index);
        }
    }

    function checkInput(){
            var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
            if ($.common.isEmpty(row)) {
                $.modal.alertWarning("请选择一条记录");
                return;
            }
            var data = { "trDate": row.trDate,"orgCode":row.orgCode,"tellerCode":row.tellerCode,"scanType":"1" }
            $.operate.post(prefix+'/checkBatchScannable',data,function (result) {
                if(result.code ==web_status.SUCCESS){
                    var scanCurrentDate = [[${#dates.format(new java.util.Date().getTime(), 'yyyymmdd')}]]
                    var v_checkNum = result.data.registerNum;
                    var ssoOrgCode = result.data.ssoOrgCode;
                    var v_subPath = result.data.subPath;
                    var v_TrDate = row.trDate;
                    var v_OrgCode = row.orgCode;
                    var trTelr = row.tellerCode;
                    var year = v_TrDate.substring(0,4);
                    var month =  v_TrDate.substring(0,4)+v_TrDate.substring(5,7);
                    var date = v_TrDate.substring(0,4)+v_TrDate.substring(5,7)+v_TrDate.substring(8,10);
                    var submitUrlArgs ="&trDate="+v_TrDate+"&tellerCode="+trTelr+"&orgCode="+v_OrgCode;
                    var v_ftpPath = "/" +year+"/" + month+"/" + date +"/"+ssoOrgCode+ "/"+ v_OrgCode+ "/" + trTelr;
                    var v_LocalPath = 'C:/northking/orms/scannedfile/'+ v_ftpPath+"/add"+scanCurrentDate;
                    v_ftpPath = v_ftpPath + "/" + v_subPath;

                    var v_otherMsg =  " 扫描信息【业务日期：" + date +"   机构:"+v_OrgCode+"  柜员:"+trTelr+"   在库影像数量："+v_checkNum+" 】";
                    window.returnValue = submitUrlArgs
                        + "@@@" + v_LocalPath
                        + "@@@" + row.id
                        + "@@@" + v_ftpPath
                        + "@@@" + v_checkNum
                        + "@@@" + v_otherMsg
                        + "@@@" + v_checkNum
                        + "@@@" + v_TrDate
                        + "@@@" + "1";
                    window.close();
                } else {
                    $.modal.msgError(result.msg);
                }

            })
    }

</script>
</html>